//
//  CalendarView.h
//  parent
//
//  Created by IreWesT on 15/5/28.
//  Copyright (c) 2015年 ci123. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol CalendarViewDelegate;
@class DayModel;

@interface CalendarView : UIView<UIScrollViewDelegate>

@property (nonatomic,retain)UIScrollView *scrollView;
@property (nonatomic,retain)UIView *currentMonthView;
@property (nonatomic,retain)UIView *todayMonthView;
@property (nonatomic,strong)id<CalendarViewDelegate> delegate;

@property (nonatomic,assign)CGFloat cellWidth;
@property (nonatomic,assign)CGFloat cellHeight;

@property (nonatomic,retain)NSDate *currentMonth;
@property (nonatomic,retain)NSDate *todayMonth;
@property (nonatomic,assign)NSInteger selectedStamp;
@property (nonatomic,assign)DayModel *selectedDayModel;
@property (nonatomic,retain)NSArray *selectedMonthData;
@property (nonatomic,assign)BOOL isAnimating;
@property (nonatomic,retain)NSMutableArray *viewsArray;
@property (nonatomic,strong)NSMutableDictionary *dataDic;
@property (nonatomic,strong)NSArray *todayMonthData;
@property (nonatomic,assign)BOOL isTodayUpdated; //todayMonthView is updated since data has been changed

- (void)showViews;

//return today month view
- (void)returnTodayMonth;
- (void)turnLastMonth;
- (void)turnNextMonth;

//重载数据图像
- (DayModel *)reloadDataWithMonth:(NSDate *)month;

@end

@protocol  CalendarViewDelegate <NSObject>

@optional

- (void)moveMonth:(NSDate *)month withOffset:(NSInteger)offset;

- (NSArray *)getDataWithMonth:(NSDate *)month;

- (void)dayClick:(DayModel *)dayModel;

- (void)showViewFinished;


@end
